import React from "react";
import "../css/home.css";
import { HashRouter, Switch, Route, Link } from "react-router-dom";
import JJ from "./JJ";
import JL from "./JL";
import TD from "./TD";
import TZZ from "./TZZ";
import WH from "./WH";
import WM from "./WM";
import XW from "./XW";
class Home extends React.Component {
  constructor(props) {
    super(props);
  }

  render() {
    return (
      <HashRouter>
        <div>
          <div className="home_title">
            <div className="home_title_ul1">
              <ul>
                <li>小米商城</li>
                <li>MIUI</li>
                <li>lOT</li>
                <li>云服务</li>
                <li>天星教课</li>
                <li>有品</li>
                <li>小爱开放平台</li>
                <li>企业团购</li>
                <li>资质证照</li>
                <li>协议规则</li>
                <li>下载app</li>
                <li>智能生活</li>
                <li>Select Location</li>
              </ul>
            </div>
            <div className="home_title_ul2">
              <ul>
                <li
                  onClick={() => {
                    this.props.history.push({
                      pathname: "/Sign",
                    });
                  }}
                >
                  登录
                </li>
                <li
                  onClick={() => {
                    this.props.history.push({
                      pathname: "/register",
                    });
                  }}
                >
                  注册
                </li>
                <li>消息通知</li>
                <li>购物车</li>
              </ul>
            </div>
          </div>
          <div className="home_head">
            <div className="home_head_a">
              <div className="home_head_add">
                <div>
                  <img
                    src="http://localhost:3000/img/login.jpg"
                    width="60px"
                    height="60px"
                  ></img>
                </div>
                <div className="home_head_ul">
                  <ul>
                    <li>全部商品分类</li>
                    <li>小米手机</li>
                    <li>Redmi红米</li>
                    <li>电视</li>
                    <li>笔记本</li>
                    <li>家电</li>
                    <li>路由器</li>
                    <li>智能硬件</li>
                    <li>服务</li>
                    <li>社区</li>
                  </ul>
                </div>
                <div className="home_head_sousuo">
                  <input type="text"></input>
                  <button>搜索</button>
                </div>
              </div>
            </div>
          </div>

          <div className="home_foot">
            <div className="home_foot_dv">
              <div className="home_foot_ul">
                <ul>
                  <li>
                    <Link to="/JJ">公司简介</Link>
                  </li>
                  <li>
                    <Link to="/TD">管理团队</Link>
                  </li>
                  <li>
                    <Link to="/WH">小米文化</Link>
                  </li>
                  <li>
                    <Link to="/JL">发展经历</Link>
                  </li>
                  <li>
                    <Link to="/XW">小米新闻</Link>
                  </li>
                  <li>
                    <Link to="/TZZ">投资者关系</Link>
                  </li>
                  <li>
                    <Link to="/WM">联系我们</Link>
                  </li>
                </ul>
              </div>
              <div className="home_foot_app">
                <Switch>
                  <Route path="/WM" component={WM}></Route>
                  <Route path="/TZZ" component={TZZ}></Route>
                  <Route path="/XW" component={XW}></Route>
                  <Route path="/JL" component={JL}></Route>
                  <Route path="/WH" component={WH}></Route>
                  <Route path="/TD" component={TD}></Route>
                  <Route path="/" component={JJ}></Route>
                </Switch>
              </div>
            </div>
          </div>
        </div>
      </HashRouter>
    );
  }
}

export default Home;
